package com.zhanggm.springcloud.student.dao;

import com.zhanggm.springcloud.student.entity.StudentEntiy;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.transaction.annotation.Transactional;

public interface StudentRepository extends JpaRepository<StudentEntiy,Long>, JpaSpecificationExecutor<StudentEntiy> {
    @Transactional
    @Modifying
    @Query(value = "delete from stu_student where id in(?1)",nativeQuery = true)
    int deleteByIds(String ids);

    @Transactional
    @Modifying
    @Query(value = "delete from StudentEntiy e where e.id in(?1)")
    int delByIds(String ids);
}
